home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-04-05 | 4.8 KB | 190 lines | [TEXT/PJMM] |
- { This file has been processed by The THINK Pascal Source Converter, v1.1. }
-
- {}
- {Created: Sunday, January 6, 1991 at 10:58 PM}
- { Processes.p}
- { Pascal Interface to the Macintosh Libraries}
- {}
- { Copyright Apple Computer, Inc. 1989-1990}
- { All rights reserved}
- {}
-
-
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
-
- unit Processes;
- interface
- uses
- Types, OSUtils, QuickDraw, Events, Files;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- type
- { type for unique process identifier }
- ProcessSerialNumberPtr = ^ProcessSerialNumber;
- ProcessSerialNumber = record
- highLongOfPSN: LONGINT;
- lowLongOfPSN: LONGINT;
- end;
-
-
- const
-
- {************************************************************************}
- { * Process identifier.}
- { ************************************************************************}
- { Various reserved process serial numbers.}
-
- kNoProcess = 0;
- kSystemProcess = 1;
- kCurrentProcess = 2;
-
- type
- {*********************************************************************************************************************************************}
- { * Definition of the parameter block passed to _Launch.}
- { *************************************************************************}
- {}
- {* Typedef and flags for launchControlFlags field}
- LaunchFlags = INTEGER;
-
- const
-
- {************************************************************************}
- { * Definition of the parameter block passed to _Launch.}
- { ************************************************************************}
-
- launchContinue = $4000;
- launchNoFileFlags = $0800;
- launchUseMinimum = $0400;
- launchDontSwitch = $0200;
- launchAllow24Bit = $0100;
- launchInhibitDaemon = $0080;
-
- type
- { Format for first AppleEvent to pass to new process. The size of the overall}
- { * buffer variable: the message body immediately follows the messageLength.}
- {}
- AppParametersPtr = ^AppParameters;
- AppParameters = record
- theMsgEvent: EventRecord;
- eventRefCon: LONGINT;
- messageLength: LONGINT;
- messageBuffer: array[0..0] of SignedByte;
- end;
-
- { Parameter block to _Launch }
- LaunchPBPtr = ^LaunchParamBlockRec;
- LaunchParamBlockRec = record
- reserved1: LONGINT;
- reserved2: INTEGER;
- launchBlockID: INTEGER;
- launchEPBLength: LONGINT;
- launchFileFlags: INTEGER;
- launchControlFlags: LaunchFlags;
- launchAppSpec: FSSpecPtr;
- launchProcessSN: ProcessSerialNumber;
- launchPreferredSize: LONGINT;
- launchMinimumSize: LONGINT;
- launchAvailableSize: LONGINT;
- launchAppParameters: AppParametersPtr;
- end;
-
-
- const
- extendedBlock = $4C43; { 'LC' }
- extendedBlockLen = (sizeof(LaunchParamBlockRec) - 12);
-
- {************************************************************************}
- { * Definition of the information block returned by GetProcessInformation}
- { ************************************************************************}
- { Bits in the processMode field}
-
- modeDeskAccessory = $00020000;
- modeMultiLaunch = $00010000;
- modeNeedSuspendResume = $00004000;
- modeCanBackground = $00001000;
- modeDoesActivateOnFGSwitch = $00000800;
- modeOnlyBackground = $00000400;
- modeGetFrontClicks = $00000200;
- modeGetAppDiedMsg = $00000100;
- mode32BitCompatible = $00000080;
- modeHighLevelEventAware = $00000040;
- modeLocalAndRemoteHLEvents = $00000020;
- modeStationeryAware = $00000010;
- modeUseTextEditServices = $00000008;
-
- type
- { Record returned by GetProcessInformation }
- ProcessInfoRecPtr = ^ProcessInfoRec;
- ProcessInfoRec = record
- processInfoLength: LONGINT;
- processName: StringPtr;
- processNumber: ProcessSerialNumber;
- processType: LONGINT;
- processSignature: OSType;
- processMode: LONGINT;
- processLocation: Ptr;
- processSize: LONGINT;
- processFreeMem: LONGINT;
- processLauncher: ProcessSerialNumber;
- processLaunchDate: LONGINT;
- processActiveTime: LONGINT;
- processAppSpec: FSSpecPtr;
- end;
-
-
- function LaunchApplication (LaunchParams: LaunchPBPtr): OSErr;
- inline
- $205F, $A9F2, $3E80;
- function LaunchDeskAccessory (pFileSpec: FSSpecPtr; pDAName: StringPtr): OSErr;
- inline
- $3F3C, $0036, $A88F;
- function GetCurrentProcess (var PSN: ProcessSerialNumber): OSErr;
- inline
- $3F3C, $0037, $A88F;
- function GetFrontProcess (var PSN: ProcessSerialNumber): OSErr;
- inline
- $70FF, $2F00, $3F3C, $0039, $A88F;
- function GetNextProcess (var PSN: ProcessSerialNumber): OSErr;
- inline
- $3F3C, $0038, $A88F;
- function GetProcessInformation (PSN: ProcessSerialNumber; var info: ProcessInfoRec): OSErr;
- inline
- $3F3C, $003A, $A88F;
- function SetFrontProcess (PSN: ProcessSerialNumber): OSErr;
- inline
- $3F3C, $003B, $A88F;
- function WakeUpProcess (PSN: ProcessSerialNumber): OSErr;
- inline
- $3F3C, $003C, $A88F;
- function SameProcess (PSN1: ProcessSerialNumber; PSN2: ProcessSerialNumber; var result: BOOLEAN): OSErr;
- inline
- $3F3C, $003D, $A88F;
-
-
- { UsingProcesses }
-
-
- implementation
- end.
-
-